import http from "../index";

// 系统管理员查询
export const getNotice = (data) =>
  http({
    url: "/api/notice/findNoticeWithAdmin",
    method: "post",
    data,
  });
// 企业管理员查询
export const findNoticeWithCompany = (data) =>
  http({
    url: "/api/notice/findNoticeWithCompany",
    method: "post",
    data,
  });
//按类查询
export const findNoticeAll = (data) =>
  http({
    url: "/api/notice/findNoticeAll",
    method: "post",
    data,
  });

// 新增
export const addNotice = (data) =>
  http({
    url: "/api/notice",
    method: "post",
    data,
  });

// 编辑
export const updateNotice = (data) =>
  http({
    url: "/api/notice",
    method: "put",
    data,
  });

// 删除
export const deleteNotice = (params) =>
  http({
    url: "/api/notice/?" + params,
    method: "delete",
  });

//批量删除
export const deleteBatchNotice = (data) =>
  http({
    url: "/api/notice/deleteBatch",
    method: "delete",
    data,
  });

//批量启用或删除
export const updateBatchNotice = (data) =>
  http({
    url: "/api/notice/updateStatus",
    method: "put",
    data,
  });

//根据类型查询公告
export const getNoticeByType = (params) =>
  http({
    url: "/api/notice/getNoticeByType?" + params,
    method: "get",
  });
